<?php
/**
 * @package WordPress Themes
 * @subpackage Tencent CDC Theme
 */

// Do not delete these lines
	if (isset($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
		die ('Please do not load this page directly. Thanks!');
	
	if ( post_password_required() ) { ?>
		<p class="nocomments"><?php _e('This post is password protected. Enter the password to view comments.', 'kubrick'); ?></p> 
	<?php
		return;
	}
?>

<div class="comment_list">
    <div class="boxcomments">
	<?php if ( have_comments() ) : ?>
	<ol class="commentlist">
		<li class="commenthead"><h2 id="comments"><?php comments_number('[快来抢沙发]', '[沙发没有了，板凳也不错]', '[已经有 % 条评论]'); ?></h2></li>
		<?php foreach ($comments as $comment) : ?>
		<li class="odd" id="comment-<?php comment_ID(); ?>">
		<div class="comment_avatar">
			<?php echo get_avatar( $comment,40); ?>
		</div>
		<div class="comment_box">
			<p class="commentTitle"><span><strong><?php comment_author(); ?></strong> 说</span><?php comment_date(); ?></p>
			<span class="commentContent"><?php comment_text(); ?></span>
		</div>
		<div class="clearfix"></div>
        </li>
		<?php endforeach; ?>
	</ol>

	<?php else : // If there are no comments yet ?>
		<p><?php _e('No comments yet.'); ?></p>
	<?php endif; ?>

	<?php if ( comments_open() ) : ?>
	
	<?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
	<p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_permalink() ) );?></p>
	
	<?php else : ?>
	<form action="<?php bloginfo('url'); ?>/wp-comments-post.php" method="post" id="commentform">
	<h3 id="respond">发表您的评论</h3>
	
	<?php if ( is_user_logged_in() ) : ?>
		<p><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account') ?>"><?php _e('Log out &raquo;'); ?></a></p>
	<?php else : ?>
		<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" maxlength="20" /><label>&nbsp;名字</label><span>*必填</span></p>
		<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" maxlength="50" /><label>&nbsp;邮箱</label><span>*不会被公布,必填</span></p>
		<p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" /><label>&nbsp;网站</label></p>
	<?php endif; ?>
		<p><textarea name="comment" id="comment" cols="5" rows="10" tabindex="4"></textarea></p>
		<p class="input_p"><input name="submit" type="submit" id="submit" tabindex="5" value="" />
			<input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
		</p>
	<?php do_action('comment_form', $post->ID); ?>
	</form>

<?php endif; // If registration required and not logged in ?>
<?php else : // Comments are closed ?>
<p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
<?php endif; ?>
	</div>

</div>